import request from '@/utils/request';

export function getBrand(params) {
    return request({
        url: '/v1/merchant/brand',
        method: 'get'
    });
}

export function getSettings(params) {
    return request({
        url: '/v1/merchant/config/query',
        method: 'get'
    });
}

export function updateSettings({
    id,
    headVerify,
    soldOutGoodsDisplayType,
    times,
    minWithdrawalAmount,
    settleDaysToHead,
    settleDaysToSupplier,
    autoCancleMin
}) {
    return request({
        url: '/v1/merchant/config/update',
        method: 'post',
        data: {
            id,
            headVerify,
            soldOutGoodsDisplayType,
            startStoreTime: times[0],
            endStoreTime: times[1],
            minWithdrawalAmount,
            settleDaysToHead,
            settleDaysToSupplier,
            autoCancleMin
        }
    });
}
